<div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
        <div class="x_title">
            <h2>{$pri_name}</h2>
            <div class="clearfix"></div>
        </div>
        <div class="x_content">
            <form class="form-horizontal form-label-left" novalidate action="" id="commentForm" method="post" enctype="multipart/form-data">
                {notempty name="code"}<p><code>备注:</code>{$code}</a></p>{/notempty}
                <!--<span class="section">Personal Info</span>-->
                {:html_text('标题','title',$info)}
                {:html_select('文章栏目','article_type_id',$info,$article_type)}
                {:html_upload_one('单个图片','single_pic',$info,['180','180'])}
                {:html_upload_one('Logo','logo_pic',$info,['180','180'])}
                {:html_text('姓名','name',$info)}
                {:html_text('手机号','mobile',$info)}
                {:html_text('设备类型','device_type',$info)}
                {:html_text('公司名称','company_name',$info)}
                {:html_text('价格','price',$info)}
                {:html_text('运费','freight_fee',$info)}
                {:html_textarea('描述','describe',$info)}
                {:html_editor('内容','content',$info)}
                {:html_number('排序','sort',$info)}
                {:html_radio('首页推荐','index_status',$info, [1=>'开启',2=>'关闭'])}
                {:html_radio('状态','status',$info, [1=>'开启',2=>'关闭'])}
                {:html_datetime('创建时间','create_time',$info)}
                
                <div class="ln_solid"></div>
                <div class="form-group">
                    <div class="col-md-6 col-md-offset-3">
                        <button id="send" type="submit" class="btn btn-success">提交</button>
                        <div class="btn btn-primary" onclick="history.go(-1)">返回</div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>

   $('[name=article_type_id]').change(function(){
       var article_type_id = $(this).val();
       if(article_type_id == 4){

           $('[name=logo_pic]').parents('.form-group').hide();
           $('[name=name]').removeAttr('required').parents('.form-group').hide();
           $('[name=mobile]').removeAttr('required').parents('.form-group').hide();
           $('[name=device_type]').removeAttr('required').parents('.form-group').hide();
           $('[name=company_name]').removeAttr('required').parents('.form-group').hide();
           $('[name=price]').removeAttr('required').parents('.form-group').hide();
           $('[name=freight_fee]').removeAttr('required').parents('.form-group').hide();
           $('[name=describe]').removeAttr('required').parents('.form-group').hide();
           $('[name=content]').parents('.form-group').show();
       }else{
           $('[name=logo_pic]').parents('.form-group').show();
           $('[name=name]').parents('.form-group').show();
           $('[name=mobile]').parents('.form-group').show();
           $('[name=device_type]').parents('.form-group').show();
           $('[name=company_name]').parents('.form-group').show();
           $('[name=price]').parents('.form-group').show();
           $('[name=freight_fee]').parents('.form-group').show();
           $('[name=describe]').parents('.form-group').show();
           $('[name=content]').parents('.form-group').hide();
       }
   });
   var article_type_id = {$info.article_type_id??0};
   if(article_type_id == 4){

       $('[name=logo_pic]').parents('.form-group').hide();
       $('[name=name]').removeAttr('required').parents('.form-group').hide();
       $('[name=mobile]').removeAttr('required').parents('.form-group').hide();
       $('[name=device_type]').removeAttr('required').parents('.form-group').hide();
       $('[name=company_name]').removeAttr('required').parents('.form-group').hide();
       $('[name=price]').removeAttr('required').parents('.form-group').hide();
       $('[name=freight_fee]').removeAttr('required').parents('.form-group').hide();
       $('[name=describe]').removeAttr('required').parents('.form-group').hide();
       $('[name=content]').parents('.form-group').show();
   }
</script>

